# list 列表学习 多个数据可以用列表，不用一个个设置变量来赋值
shopping_list = []
# 添加 append（“值”）
shopping_list.append("显示器")
shopping_list.append("键盘")
shopping_list.append("妙控板")
shopping_list.append("音响")
# 可以直接打印
print(shopping_list)
# 删除 remove（“值”）
shopping_list.remove("妙控板")
shopping_list.remove("键盘")
print(shopping_list)

shopping_list.append("显示器")
shopping_list.append("键盘")
shopping_list.append("妙控板")
shopping_list.append("音响")
# len（list）显示长度
print(len(shopping_list))
# 可以用序号来指定对应位置的值，进行增删查改
print(shopping_list[2])
print(shopping_list[4])
print(shopping_list[len(shopping_list)-1])
shopping_list[0] = "macbook"
print(shopping_list)

# 内置各种方法 max min sorted等
price_list = [5549,784,200,10,8894,1049,411,11]
max_price = max(price_list)
min_price = min(price_list)
sort_price = sorted(price_list)
print(max_price)
print(min_price)
print(sort_price)
